FROM 172.17.1.10/ci/maven:3.4.5 AS builder
RUN mkdir /opt/app -p
WORKDIR /opt/app
 
COPY . .
RUN mvn clean package deploy  -P uat1 -DskipTests=true
 
FROM 172.17.1.10/ci/jdk:1.8.0
 
# environment identify, like T1、T2、T3、beta
RUN mkdir /opt/case/tongyong_conf/apollo -p && \
    echo "idc=beta" >> /opt/case/tongyong_conf/apollo/server.properties && \
    echo "env=UAT" >> /opt/case/tongyong_conf/apollo/server.properties  && \
    echo "uat_meta=http://t1-managerdaikuan.2345.com:8080" >> /opt/case/tongyong_conf/apollo/server.properties
 
# 拷贝maven生成物 jar
COPY --from=builder /opt/app/manager-service/target/manager-service.jar manager-service.jar
 
# 拷贝启动脚本
COPY --from=builder /opt/app/entrypoint.sh /opt/app
RUN dos2unix /opt/app/entrypoint.sh && chmod +x /opt/app/entrypoint.sh
 
# 暴露端口
EXPOSE 10016 20015
 
# 启动命令
ENTRYPOINT ["/opt/app/entrypoint.sh"]